/* file name  : STUNTEventAdapter.java
 * authors    : Saikat Guha <saikat@cs.cornell.edu>
 * created    : Sat 24 Sep 2005 03:48:58 PM EDT
 * copyright  : GNU Lesser General Public License version 2.1 or later
 *
 * Copyright (C) 2005 Saikat Guha <saikat@cs.cornell.edu>
 *
 * This library is free software; you can redistribute it and/or modify it under the terms
 * of the GNU Lesser General Public License as published by the Free Software Foundation;
 * either version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 *  without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License along with this
 * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
 * Boston, MA 02111-1307 USA
 *
 */
package net.nutss.stunt;

import java.net.Socket;
import java.nio.channels.DatagramChannel;
import java.net.URI;

/**
 * A null implementation of all the socket events, which can be adapted by other classes.
 *
 * @author Saikat Guha
 * @version %I%, %G%
 */
public class STUNTEventAdapter implements STUNTEventListener {

    public void errorHandler(Exception e) {}

    /** @deprecated */
    public void connectHandler(Socket s) { try { s.close(); } catch (Exception e) { } }
    /** @deprecated */
    public void acceptHandler(Socket s, URI u) { try { s.close(); } catch (Exception e) { } }

    public void connectUDPHandler(STUNTUDPSocket s) { try { s.close(); } catch (Exception e) { } }
    public void acceptUDPHandler(STUNTUDPSocket s, URI u) { try { s.close(); } catch (Exception e) { } }

    public void connectTCPHandler(Socket s) { connectHandler(s); }
    public void acceptTCPHandler(Socket s, URI u) { acceptHandler(s, u); }
}
